Field of the Invention
The present invention relates to a single instruction multiple data (SIMD) processor with a very long instruction word (VLIW) architecture.
Description of the Background Art
Image processors have been developed to accommodate various functional changes in image recognition processing.
For example, Patent Literature 1 (Japanese Unexamined Patent Application Publication No. 2012-221131) describes an image processor that performs image recognition using Histogram of Oriented Gradients (HOG).
In such image recognition, the histogram of oriented gradient (HOG) may be generated through the processing (1) to (3) below.
(1) For each target pixel to be processed (with the coordinates (x, y) and the pixel value I (x, y)), a gradient intensity dx(x, y) in X-direction between the target pixel and its adjacent pixels to the right and the left is calculated using the formula below.dx(x,y)=I(x+1,y)−I(x−1,y)
A gradient intensity dy(x, y) in Y-direction between the target pixel and its adjacent pixels above and below is then calculated using the formula below.dy(x,y)=I(x,y+1)−I(x,y−1)
(2) A gradient vector angle for the target pixel, which is referred to as gradient (x, y), is calculated using the value obtained by dividing the gradient intensity dy(x, y) in Y-direction by the gradient intensity dx(x, y) in X-direction, using the formula below:gradient(x,y)=atan(dy(x,y)/dx(x,y)),
where atan( ) is an inverse tangent (arctangent).
(3) The calculated gradient vector angle, gradient (x, y), and the signs (plus and minus) of the gradient intensities dx(x, y) and dy(x, y) are used to determine the gradient vector direction of the target pixel. The determined gradient vector direction is used to generate the HOG.
As shown in FIG. 10, for example, bins BIN0 to BIN7 are eight parts equally split by an angle of π/4. For each target pixel, a bin including its gradient vector direction is determined, and the number of times the gradient vector direction is determined to fall within the bin is counted (added up). This calculation is performed for each of all the pixels of a predetermined image area (e.g. an image area consisting of N×M pixels, where N and M are natural numbers) to generate the HOG of the predetermined image area.
The image processor uses the generated HOG in, for example, image recognition.
This HOG generation may be performed for all the pixels in an image, and thus preferably uses parallel processing. Thus, a SIMD processor is suited to such data processing.
However, the HOG generation involves conditional branching dependent on the gradient vector angle gradient (x, y) to determine the gradient vector direction. A SIMD processor may use a conditional flag for such conditional branching. Each processor element (PE) of the SIMD processor can simply execute its corresponding instruction. To change the processing in accordance with the data value, the processor needs a condition flag for each processor element (PE), and each PE operates in accordance with the condition flag. When performing conditional branching using conditional flags, the SIMD processor would involve many complicated processes. This lowers the computation efficiency.
To solve this problem, the technique in Patent Literature 1 uses an additional operator (hardware) dedicated to the HOG generation. The operator performs the processing to generate HOGs to prevent the computation efficiency from decreasing.
However, the technique in Patent Literature 1 uses a fixed number of HOG bins and a fixed range of each bin (angular range), disabling the number of bins and the range of each bin (angular range) to be variable. The operator (hardware) circuitry dedicated to generating HOGs has no other uses. More specifically, for example, the circuit for range determination used to generate HOGs cannot be used for range determination of other purposes. The range determination is commonly used in image processing and image recognition and thus is preferably implemented in the form of versatile hardware incorporated in the SIMD processor.
In response to the above problems, it is an object of the present invention to provide a SIMD processor with a hardware configuration that enables efficient implementation of range determination commonly used in image processing and image recognition.